//
//  BookManager.m
//  OC03-HomeWork
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 高雅馨. All rights reserved.
//

#import "BookManager.h"

@implementation BookManager
- (instancetype)initWithBookArr:(NSMutableArray *)bookArr {
    self = [super init];
    if (self) {
        _bookArr = bookArr;
    }
    return self;
}
+ (instancetype)bookManagerWithBookArr:(NSMutableArray *)bookArr {
    return [[BookManager alloc] initWithBookArr:bookArr];
}
- (void)addBook:(Books *)book {
    [self.bookArr addObject:book];
}
- (void)deleBook:(Books *)book {
    [self.bookArr removeObject:book];
}
- (void)display {
    NSMutableArray *bookName = [NSMutableArray array];
    for (NSInteger i = 0; i < self.bookArr.count; i++) {
        Books *books = [self.bookArr objectAtIndex:i];
        [bookName addObject:books];
    }
    NSLog(@"%@", bookName);
}
@end
